<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})"></head>
<style>
	.serviceType{
		padding-left: 0px;
		white-space:nowrap;
	}
</style>
<body>
	<form class="layui-form" action="" lay-filter="service_type-update-form" style="height: 100%;margin-top: 20px;margin-left: 20%">
		<input name="serviceTypeId" th:value="${serviceType.serviceTypeId}"
			type="hidden">
		<!--  -->
 		<!--  -->
		<div class="layui-form-item">
			<label class="layui-form-label serviceType">服务类型名称：</label>
			<div class="layui-input-inline">
				<input class="layui-input" lay-verify="required" autocomplete="off" id="serviceTypeName"
					th:value="${serviceType.serviceTypeName}" name="serviceTypeName"
					placeholder="请输入服务类型名称">
			</div>
		</div>
 		<!--  -->
		<div class="layui-form-item">
			<label class="layui-form-label serviceType" >是否汽车行业：</label>
			<div class="layui-input-inline">
				<input type="radio" name="isShopAvailable" value="1" title="是">
				<input type="radio" name="isShopAvailable" value="0" title="否" checked>
			</div>
		</div>
 		<div class="layui-form-item" >
			<div class="layui-input-inline">
				<button class="layui-btn" style="margin-left: 55%" lay-submit="" lay-filter="service_type-update">立即提交</button>
			</div>
		</div>
	</form>
	<script th:replace="/common/template :: script"></script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
		layui.use([ 'layer', 'jquery', 'form', 'laydate' ], function() {
			var $ = layui.jquery;
			var laydate = layui.laydate;
			var layer = layui.layer;
			var form = layui.form;


			$("input[name=isShopAvailable][value='1']").attr("checked", '[[${serviceType.isShopAvailable}]]' == '1' ? true : false);
			$("input[name=isShopAvailable][value='0']").attr("checked", '[[${serviceType.isShopAvailable}]]' == '0' || '[[${serviceType.isShopAvailable}]]'==null  ? true : false);
			form.render('radio')
			//监听提交
			form.on('submit(service_type-update)', function(data) {
				//提交数据data.field
				CoreUtil.ajaxPostLoad("/service/type/update", data.field,true,parent.active);
				return false;
			});
		});
	</script>
</body>
</html>